﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Authentication;

namespace HeThongThongTin.UI.SL
{
    public partial class StartView : UserControl, Csla.Xaml.ISupportNavigation
    {

        #region ISupportNavigation Members

        public bool CreateBookmarkAfterLoadCompleted
        {
            get { return true; }
        }

        public event EventHandler LoadCompleted;

        protected virtual void OnLoadCompleted()
        {
            if (LoadCompleted != null)
                LoadCompleted(this, EventArgs.Empty);
        }

        public void SetParameters(string parameters)
        {
            // no parameters
        }

        public string Title
        {
            get { return "Start view"; }
        }

        #endregion

        public StartView()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            /*Authentication.CustomIdentity.Login("ADMIN", "ADMIN", (o, ex) =>
            {
                if (ex.Error == null)
                {
                    var principal = new CustomPrincipal(ex.Object);
                    Csla.ApplicationContext.User = principal;
                }
                else
                {
                    MessageBox.Show(ex.Error.Data.ToString());
                }
            });*/
        }
    }
}
